package edu.snake.implement.utils;

import edu.snake.core.utils.Pair;
import edu.snake.implement.model.CharacterName;

public class PairCharacterName implements Pair<CharacterName> {
    private CharacterName first;
    private CharacterName second;

    public PairCharacterName(CharacterName first, CharacterName second) {
        this.first = first;
        this.second = second;
    }

    public CharacterName getFirst() {
        return first;
    }



    public CharacterName getSecond() {
        return second;
    }



    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof PairCharacterName)) return false;

        PairCharacterName that = (PairCharacterName) o;

        return first == that.first && second == that.second;

    }

    @Override
    public int hashCode() {
        int result = first != null ? first.hashCode() : 0;
        result = 31 * result + (second != null ? second.hashCode() : 0);
        return result;
    }

    @Override
    public String toString() {
        return "PairCharacterName{" +
                "first=" + first +
                ", second=" + second +
                '}';
    }
}
